# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1HistogramQueryPropertyNameFilter do
  @moduledoc """


  ## Attributes

  *   `documentSchemas` (*type:* `list(String.t)`, *default:* `nil`) - This filter specifies the exact document schema(s) Document.document_schema_name to run histogram query against. It is optional. It will perform histogram for property names for all the document schemas if it is not set. At most 10 document schema names are allowed. Format: projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
  *   `propertyNames` (*type:* `list(String.t)`, *default:* `nil`) - It is optional. It will perform histogram for all the property names if it is not set. The properties need to be defined with the is_filterable flag set to true and the name of the property should be in the format: "schemaId.propertyName". The property needs to be defined in the schema. Example: the schema id is abc. Then the name of property for property MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
  *   `yAxis` (*type:* `String.t`, *default:* `nil`) - By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not set.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :documentSchemas => list(String.t()) | nil,
          :propertyNames => list(String.t()) | nil,
          :yAxis => String.t() | nil
        }

  field(:documentSchemas, type: :list)
  field(:propertyNames, type: :list)
  field(:yAxis)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1HistogramQueryPropertyNameFilter do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1HistogramQueryPropertyNameFilter.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1HistogramQueryPropertyNameFilter do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
